package terra.network.packet.server;

import org.jboss.netty.buffer.ChannelBuffer;

import terra.network.packet.Packet;

public class ObjectDelete extends Packet {

	public int oId;
	
	public ObjectDelete(int i) {
		oId = i;
	}

	public ObjectDelete() {
	}

	@Override
	public ChannelBuffer toBuffer() {
		ChannelBuffer buf = getNewBuffer();
		buf.writeByte(getId());
		buf.writeInt(oId);
		return buf;
	}

	@Override
	public Packet fromBuffer(ChannelBuffer buf) {
		oId = buf.readInt();
		return this;
	}

	@Override
	public int getLength() {
		return 5;
	}

	@Override
	public boolean isDynamicLength() {
		return false;
	}

	@Override
	public byte getId() {
		return 6;
	}
	
	@Override
	public byte getPriority() {
		return PRIOR_HIGH;
	}
}
